package com.oocl.project5.printformat;


import com.oocl.project5.doublelinklist.Node;
import com.oocl.project5.informationstore.Person;

public class PrintFormat {
	public static void printHomeInfor(){
		System.out.println("Please Enter any key to return homepage!!");
	}
	public static void printAddFormat(){
		System.out.println("Please input information you want to add!!The format is as follows "
				+ "name:XXX,sex:xx,birthday:yyyy/mm/dd...");
	}
	public static void printDeleteFormat(){
		System.out.println("Please input the id of information you want to delete!!The format is as follows "
				+ "id:XXX");
	}
	
	public static void printFormat(){
		System.out.println("Please input the id of information you want to updata!!The format is as follows "
				+ "id:XXX");
	}
	public static void printUpdataFormat(){
		System.out.println("Please input information you want to add!!The format is as follows "
				+ "name:XXX,sex:xx,birthday:yyyy/mm/dd...");
	}
	public static void printLookFormat() {
		System.out.println("Please input id:xx,name:xx or sex:xx to view information ");
	}
	public static void printError(){
		System.out.println("Input Error !!!");
	}
	public static void printNotFind(){
		System.out.println("Not find the information you want !!!");
	}
	public static void printSort() {
		System.out.println("Please enter id or name to sort all information ");
	}
	public static void printConfirm() {
		System.out.println("Do you ensure delete !! Please input 'Y' to confirm it !!");
	}
	public static void printSucess() {
		System.out.println("Sucess !!");
	}
	public static void printErrorField(String field) {
		System.out.println(field+" is error field ");
	}
	public static void printException() {
		System.out.println("The characters you entered do not meet the requirements!!!");
		System.out.println("Please input again!!!");
	}
	public static void printLookPrompt() {
		System.out.println("Please enter A or C to view all information "
				+ "or conditions to view the information");
		System.out.println("A   All ");
		System.out.println("C   Condition");
	}
	public  static void printHelps(){
		System.out.println("A -> Add: add person information !! ");
		System.out.println("D -> Delete: Delete person information !!  ");
		System.out.println("U -> Update: Updata person information !!  ");
		System.out.println("L -> Find: View all information or find according to condition !!  ");
		System.out.println("S -> Sort: Sort by id or Name !!  ");
		System.out.println("H -> Help: View the help documentation !!  ");
	}
	
	public static void printPerson(Person[] person){
		int len = person.length;
		for(int i=0;i<len&&person[i]!=null;i++){
			System.out.println("Id:"+person[i].getId()+"\t\t"+"Name:"+person[i].getName()+"\t\t"+"Sex:"+person[i].getSex()+"\t\t"
			         +"Birthday:"+person[i].getBirthday()+"\t\t"+"Call:"+person[i].getCall()+"\t\t"+"Address:"+person[i].getAddress());
		}
	}
	
	public static void printPersonAll(Node<Person> headperson){
		Node<Person> curperson = headperson;
		//System.out.println("Id\t\tName\t\tSex\t\tBirthday\t\tCall\t\t\tAddress");
		while(curperson!=null){
			System.out.println("Id:"+curperson.getData().getId()+"\t\t"+"Name:"+curperson.getData().getName()+"\t\t"+"Sex:"+curperson.getData().getSex()+"\t\t"
			         +"Birthday:"+curperson.getData().getBirthday()+"\t\t"+"Call:"+curperson.getData().getCall()+"\t\t"+"Address:"+curperson.getData().getAddress());
			curperson=curperson.getNext();
		}
	}
	
	public static void printPersonOne(Node<Person> headperson){
		Node<Person> curperson = headperson;
		System.out.println("Id:"+curperson.getData().getId()+"\t\t"+"Name:"+curperson.getData().getName()+"\t\t"+"Sex:"+curperson.getData().getSex()+"\t\t"
		         +"Birthday:"+curperson.getData().getBirthday()+"\t\t"+"Call:"+curperson.getData().getCall()+"\t\t"+"Address:"+curperson.getData().getAddress());
	}
}
